//
//  CSearchView.h
//  HCHK_iphone
//
//  Created by yilong zhang on 11-12-19.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "CSearchConditionView.h"
#import "CTextField.h"

//===============================================================================================

@class CSearchConditionView;

//===============================================================================================

@protocol SearchViewDelegate <NSObject>

@optional
-(void)DidSearchViewEdited;
-(void)DidSearchViewSelected:(int)index Text:(NSString*)text;

@end

//===============================================================================================

@interface CSearchBar : UISearchBar

@end

//===============================================================================================

@interface CSearchView : UIView <UISearchBarDelegate, SearchConditionViewDelegate>

@property (nonatomic, assign) id<SearchViewDelegate> delegate;
@property (nonatomic, assign) CSearchBar          *m_SearchBar;
//@property (nonatomic, assign) CSearchConditionView *m_SearchCondition;

-(void)InitSearchView;
-(void)AddSearchConditionView:(CSearchConditionView*)view;
-(BOOL)CheckIuput:(NSString*)value Range:(NSRange)range;
//-(void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText;
-(BOOL)CheckSpecialCharacters:(NSString*)value;
-(BOOL)CheckChineseCharacters:(NSString*)value;

@end
